package demo02;

/**
 * @program: qy158
 * @description:
 * @author: 闫克起2
 * @create: 2022-10-25 09:26
 **/
public class Test {
    public static void main(String[] args) {
        //整型
        Point<Integer> p1=new Point<>(15,16);
        //无需在强制转换---不会造成数据类型安全问题
        Integer x = p1.getX();
        Integer y = p1.getY();
        System.out.println(p1);


        Point<String> p2=new Point<>("东经150度","北纬25度");
        String y1 = p2.getY();
        String x1 = p2.getX();
        System.out.println(p2);

        //我们在定义类时 指定泛型的标识可以有多个。
        Info<Integer,Double,String> info=new Info<>();
        info.a=25;


    }
}
class Info<A,B,C>{
    public A a;
    public B b;
    public C c;
}
